﻿<%@ Page Language="C#" MasterPageFile="~/Views/Shared/AdministratorSite.Master" Inherits="System.Web.Mvc.ViewPage" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
    Home Page
</asp:Content>
<script runat="server">
    public void Page_Load()
    {
        GridViewSearchResult.DataSource = ViewData["searchResult"];
        GridViewSearchResult.DataBind();
        foreach (GridViewRow gvr in GridViewSearchResult.Rows)
        {
            ((HyperLink)gvr.Cells[0].Controls[0]).NavigateUrl = "~/AdminMain/ViewDetails?type=" + ViewData["resultType"] +
                                   "&key1="+ gvr.Cells[1].Text.ToString()+
                                   "&key2="+ gvr.Cells[2].Text.ToString()+
                                   "&key3="+ gvr.Cells[3].Text.ToString();
        }
    }
    public void doSomething(int val)
    {
        int t = 0;
    }
    
</script>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">

    <form id="form1" runat="server" action="Search">
        <asp:Panel ID="Panel2" runat="server" Height="61px" 
        style="font-size: xx-large; font-weight: 700; font-family: Calibri">
        <b>Search</b></asp:Panel>
        
        <table style="width: 100%">
            <tr>
                <td style="width: 82px" valign="top">
                    &nbsp;</td>
                <td style="width: 82px">
                    &nbsp;</td>
                <td valign="top">
                <h2><%: ViewData["Message"] %></h2></td>
                <td>
                Sort by <%= Html.DropDownList("sortBy", ViewData["dropdownList"] as List<SelectListItem>,
                                            new
                                            {
                                                style = "width: 100px",
                                                onchange = "window.location.reload()"
                                            })%></td>
            </tr>
            <tr>
                <td style="width: 82px" valign="top">
        <table class="clear" border="" frame="border" 
            style="border-style: hidden; border-width: 0; border-spacing: 0px;">
            <tr>
                <td style="border-style: hidden; width: 83px" rowspan="3"></td>
                <td style="border-width: 0px; border-style: 0; width: 120px;">
                    <%= Html.RadioButton("radioButtonListMainSearch", "_hotel", true)%> Hotel
                </td>
                <td style="border-style: hidden">
                 <%: Html.DropDownList("searchHotelCriteria", new[] {
                                                                            new SelectListItem { Value = "_name", Text = "Name" },
                                                                            new SelectListItem { Value = "_address", Text = "Address" },
                                                                            new SelectListItem { Value = "_country", Text = "Country" },
                                                                           },
                                                               new { 
                                                                            style = "width: 100px" 
                                                                    }
                                                                                    
                                         )%>

                </td>
                <td style="border-style: hidden">
                    &nbsp;</td>
            </tr>
            <tr>
                <td style="border-width: 0px; border-style: 0; width: 120px;">
                    <%= Html.RadioButton("radioButtonListMainSearch", "_client")%> Client
                </td>
                <td style="border-style: hidden">
                    <%: Html.DropDownList("searchClientCriteria", new[] {
                                                                            new SelectListItem { Value = "_email", Text = "Email" },
                                                                            new SelectListItem { Value = "_name", Text = "Name" },
                                                                            new SelectListItem { Value = "_passportNo", Text = "Passport ." },
                                                                            new SelectListItem { Value = "_contact", Text = "Contact" }
                                                                           },
                                                                  new {
                                                                            style = "width: 100px"
                                                                       }
                                                                                    
                                         )%>

                </td>
                </td>
                <td style="border-style: hidden">
                    &nbsp;</td>
            </tr>
            <tr>
                <td style="border-width: 0px; border-style: 0; width: 120px;">
                    <%= Html.RadioButton("radioButtonListMainSearch", "_transaction")%> Transaction
                </td>
                <td style="border-style: hidden">
                    <%: Html.DropDownList("searchTransactionCriteria", new[] {
                                                                            new SelectListItem { Value = "_id", Text = "ID" },
                                                                            new SelectListItem { Value = "_startDates", Text = "Start Date"},
                                                                            new SelectListItem { Value = "_endDate", Text = "End Date" },
                                                                           },
                                                                       new {
                                                                            style = "width: 100px"
                                                                       }                                      
                                         )%>
                </td>
                <td style="border-style: hidden">
                    &nbsp;</td>
            </tr>
            <tr>
                <td style="border-style: hidden; width: 83px"></td>
                <td style="border-width: 0px; border-style: 0; width: 120px;">&nbsp;</td>
                <td style="border-style: hidden">
                    &nbsp;</td>
                <td style="border-style: hidden">
                    &nbsp;</td>
            </tr>
            <tr>
                <td style="border-style: hidden; width: 83px"></td>
                <td style="border-width: 0px; width: 120px;" colspan="2" 
                    align="center">
                     <%: Html.TextBox("searchString", "") %></td>
                <td style="border-style: hidden">
                    &nbsp;</td>
            </tr>
            <tr>
                <td style="border-style: hidden; width: 83px">&nbsp;</td>
                <td style="border-width: 0px; border-style: 0; width: 120px;" colspan="2" 
                    align="center">
    <asp:Button ID="Button1" type="submit" name="submitButton" runat="server" Text="Search" 
                        style="text-align: left" TabIndex="6"/>
    
                </td>
                <td style="border-style: hidden">
                    &nbsp;</td>
            </tr>
            </table>
                </td>
                <td style="width: 82px">
                    &nbsp;</td>
                <td valign="top" colspan ="2">



        <asp:GridView ID="GridViewSearchResult" runat="server" CellPadding="5" 
        ForeColor="#333333" GridLines="None" BorderStyle="Solid" 
        BorderWidth="1px" CellSpacing="7" ShowFooter="True" AllowSorting="True">
            <AlternatingRowStyle BackColor="White" />
            <EditRowStyle BackColor="#2461BF" />
            <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
            <HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
            <PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
            <RowStyle BackColor="#EFF3FB" />
            <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
            <SortedAscendingCellStyle BackColor="#F5F7FB" />
            <SortedAscendingHeaderStyle BackColor="#6D95E1" />
            <SortedDescendingCellStyle BackColor="#E9EBEF" />
            <SortedDescendingHeaderStyle BackColor="#4870BE" />
            <Columns>
                <asp:HyperLinkField Text="View Details" />
           </Columns>
            
        </asp:GridView>



                </td>
            </tr>
            <tr>
                <td style="width: 82px" valign="top">
                    &nbsp;</td>
                <td style="width: 82px">
                    &nbsp;</td>
                <td>
                    &nbsp;</td>
            </tr>
        </table>

        <div>
    </div>
    </form>
</asp:Content>
